
#include <iostream>

using namespace std;


typedef struct{
    int a,b,c,d;
}S;


/**
 * object 和其 reference 的大小相同，地址也相同
 * (有编译器实现的假象)
*/
int main()
{

    double x = 9;
    double *px = &x;
    double& rx = x;

    cout << sizeof(x) << endl;
    cout << sizeof(px) << endl;
    cout << sizeof(rx) << endl;

    cout << &x << " " << px << " " << &rx << endl;


    S s;
    S *ps = &s;
    S& rs = s;
    cout << sizeof(s) << endl;
    cout << sizeof(ps) << endl;
    cout << sizeof(rs) << endl;

    cout << &s << " " << ps << " " << &rs << endl;


    return 0;
}